package com.ruoyi.system.service.impl

import com.ruoyi.system.domain.SysOperLog
import com.ruoyi.system.mapper.SysOperLogMapper
import com.ruoyi.system.service.ISysOperLogService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * 操作日志 服务层处理
 *
 * @author ruoyi
 */
@Service
open class SysOperLogServiceImpl : ISysOperLogService {
    @Autowired
    private lateinit var operLogMapper: SysOperLogMapper

    /**
     * 新增操作日志
     *
     * @param operLog 操作日志对象
     */
    override fun insertOperlog(operLog: SysOperLog?) {
        operLogMapper.insertOperlog(operLog)
    }

    /**
     * 查询系统操作日志集合
     *
     * @param operLog 操作日志对象
     * @return 操作日志集合
     */
    override fun selectOperLogList(operLog: SysOperLog?): List<SysOperLog> {
        return operLogMapper.selectOperLogList(operLog)
    }

    /**
     * 批量删除系统操作日志
     *
     * @param operIds 需要删除的操作日志ID
     * @return 结果
     */
    override fun deleteOperLogByIds(operIds: Array<Long>): Int {
        return operLogMapper.deleteOperLogByIds(operIds)
    }

    /**
     * 查询操作日志详细
     *
     * @param operId 操作ID
     * @return 操作日志对象
     */
    override fun selectOperLogById(operId: Long?): SysOperLog? {
        return operLogMapper.selectOperLogById(operId)
    }

    /**
     * 清空操作日志
     */
    override fun cleanOperLog() {
        operLogMapper.cleanOperLog()
    }
}
